set(WIFI_SSID "${WIFI_SSID}" CACHE INTERNAL "WiFi SSID for examples")
set(WIFI_PASSWORD "${WIFI_PASSWORD}" CACHE INTERNAL "WiFi password for examples")

add_subdirectory_exclude_platforms(blink)
add_subdirectory_exclude_platforms(wifi_scan)
add_subdirectory_exclude_platforms(access_point)

if ("${WIFI_SSID}" STREQUAL "")
    message("Skipping some Pico W examples as WIFI_SSID is not defined")
elseif ("${WIFI_PASSWORD}" STREQUAL "")
    message("Skipping some Pico W examples as WIFI_PASSWORD is not defined")
else()
    add_subdirectory_exclude_platforms(freertos)
    add_subdirectory_exclude_platforms(httpd)
    add_subdirectory_exclude_platforms(iperf)
    add_subdirectory_exclude_platforms(ntp_client)
    add_subdirectory_exclude_platforms(tcp_client)
    add_subdirectory_exclude_platforms(tcp_server)
    add_subdirectory_exclude_platforms(udp_beacon)
    add_subdirectory_exclude_platforms(http_client)
    add_subdirectory_exclude_platforms(mqtt)

    if (NOT TARGET pico_mbedtls)
        message("Skipping tls_client and ota_update examples as Mbed TLS is not available")
    else()
        add_subdirectory_exclude_platforms(tls_client)
        # note ota_update doesn't use Mbed TLS, but it requires picotool with Mbed TLS, so the above check is a good proxy
        add_subdirectory_exclude_platforms(ota_update rp2040)
    endif()
endif()
